import hashlib
import re


def makepwd(pwd):
    new_pwd = pwd.encode('utf8')
    res = hashlib.md5(new_pwd).hexdigest()
    return res

# str = '1223_ahdnfd__'
# print(makepwd(str))


str = 'w1234567'

ret = re.search(r'(^[a-zA-Z]\d+\w*)',str,re.I)
if ret:
    print (ret.group())
else:
    print ('未找到')